<!-- 告警 》 电子地图 -->

<template>
  <CommonBody v-bind="bodyProps" noPadding @change="toChange">
    <template #treeNode="{ data, nodeClass }">
      <AreaNode :data="data" :nodeClass="nodeClass" />
    </template>

    <div v-if="map_info.id">
      <MapView />
    </div>

    <MapEmpty v-else />

    <MyCount />

    <MyModal />
  </CommonBody>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import mixMap from '@admin/views/Secure/mixMap'
import store from './store'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'AlarmMap',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [mixMap('', store)],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(
    require.context('@admin/views/Maintain/Alarm/AlarmGaode', true, /vue$/),
    require.context('./', true, /vue$/),
  ),

  /**
   * 监听属性 (深度 deep 首次 immediate)
   */
  watch: {
    /**
     * 监听区域选择
     */
    'map_infoParam.areaId'(areaId) {
      this.param.mapAreaId = areaId
      this.startList()
      this.startInfo()
    },
  },
}
</script>
